#include "my_array.h"
#include <iostream>
#include <cstring>

using namespace std;


Array::Array()
{
    // 无参构造
    mCapacity = 100;
    mSize = 0;
    mAddr = new int[mCapacity];
}

Array::Array(int cap)
{
    // 有参构造
    mCapacity = cap;
    mSize = 0;
    mAddr = new int[mCapacity];
}

Array::Array(const Array &ob)
{
    // 拷贝构造
    mCapacity = ob.mCapacity;
    mSize = ob.mSize;
    mAddr = new int[mCapacity];
    memcpy(mAddr, ob.mAddr, mSize * sizeof(int));
}

Array::~Array()
{
    // 析构函数
    delete[] mAddr;
}

void Array::setData(int pos, int val)
{
    int v = val - 1;
    if (v < 0)
    {
        cout << "插入无效" << endl;
        return;
    }
    else if (v >= mSize)
    {


    }
    else 
    {
        
    }


    return;
}